<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>组织机构编辑</title>
	<%@ include file="../../include/head.jsp"%>
</head>
<body>
<div class="admin-content">
	<div class="am-g">
		<div class="am-u-sm-12">
			<form class="am-form am-form-horizontal" data-am-validator modelAttribute="organization" action="${ctx}/organization/update" method="post">
				<input type="hidden" name="parentId" value="${organization.id}" />
				<input type="hidden" name="parentIds" value="${organization.parentIds}${organization.id}/" />
				<div class="am-form-group">
					<label class="am-u-sm-3 am-form-label">上级机构：</label>
					<div class="am-u-sm-8">
						<input type="text" id="parentName" value="${organization.name}" readonly/>
					</div>
					<label class="am-u-sm-1"></label>
				</div>
				<div class="am-form-group">
					<label class="am-u-sm-3 am-form-label"><span class="error">*</span>机构名称：</label>
					<div class="am-u-sm-8">
						<input type="text" minlength="2" name="name" placeholder="机构名称（至少2个字符）" required />
					</div>
					<label class="am-u-sm-1"></label>
				</div>
				<div class="am-form-group">
					<label class="am-u-sm-3 am-form-label">是否可用：</label>
					<div class="am-u-sm-8">
						<select name="available" data="true">
							<option value="true">可用</option>
							<option value="false">禁用</option>
						</select>
					</div>
					<label class="am-u-sm-1"></label>
				</div>
				<div class="am-form-group">
					<div class="am-u-sm-9 am-u-sm-push-3">
						<shiro:hasPermission name="sys:organization:edit"><button type="submit" class="am-btn am-btn-primary">保存</button></shiro:hasPermission>
						<button type="button" class="am-btn am-btn-danger" onclick="closeModel(false)">关闭</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<%@ include file="../../include/bottom.jsp"%>
<script type="text/javascript">
	$(function () {
		//消息提醒
		var msg = '${msg}';
		if(msg!=''){
			iuMsg(msg);
			closeModel(true);//关闭窗口
		}
		initSelectValue(true);//初始化下拉框的值
	});
</script>
</body>
</html>
